package com.usian.service.impl;

import com.usian.mapper.UserMapper;
import com.usian.pojo.User;
import com.usian.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public User selectByNAame(User user) {

        return userMapper.selectByNAame(user);
    }

    @Override
    public void insertUser(User user) {

        //因为表里有日期，这里直接在这天 的日期
        user.setCreatetime(new Date());
        userMapper.insertUser(user);
    }
}
